<template>
  <div class="lxh-title">
    <div class="title-back" @click="handleBack">
      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 30">
        <path fill-rule="evenodd" d="M6.600,15.000 L7.600,14.000 L17.400,4.200 C18.174,3.426 18.174,2.174 17.400,1.399 L17.400,1.399 C16.626,0.626 15.373,0.626 14.599,1.399 L0.001,15.999 L0.001,15.999 L14.599,30.599 C15.373,31.374 16.626,31.374 17.400,30.599 L17.400,30.599 C18.174,29.825 18.174,28.574 17.400,27.799 L7.600,18.000 L6.600,17.000" />
      </svg>
    </div>
    <div class="title-text">{{ title }}</div>
  </div>
</template>

<script>
export default {
  name: 'LTitle',
  props: {
    title: {
      type: String,
      default: ''
    },
    // 是否自定义事件
    customClickEvent: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleBack() {
      console.log(this.$router)
      this.$emit('click')
      if (!this.customClickEvent) {
        this.$router.back()
      }
    }
  }
}
</script>

<style lang="less" scoped>
.lxh-title{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  height: 88px;
  padding: 0 28px;
  text-align: center;
  line-height: 88px;
  font-size: 36px;
  color: #191919;
  .title-back{
    position: absolute;
    width: 20px;
  }
}
</style>
